import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ball_lion/entity/expert/plan_Info_entity.dart';

import 'package:ball_lion/resources/colours.dart';
import 'package:ball_lion/server/api/user_api.dart';
import 'package:ball_lion/widgets/base/wqs_text.dart';
import 'package:ball_lion/widgets/base/wqs_bottomsheet.dart';
import 'package:ball_lion/widgets/base/wqs_button.dart';

class FocusBottomSheet extends StatelessWidget {
  const FocusBottomSheet({super.key, required this.planInfo});

  final PlanInfoEntity? planInfo;

  @override
  Widget build(BuildContext context) {
    return QsBottomSheet(
        closeResult: true,
        child: Padding(
          padding: const EdgeInsets.all(16),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Container(height: 10),
              Column(
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  QsText("专家已设置粉丝不中退款",
                      fontSize: 18, fontWeight: FontWeight.w500),
                  Container(height: 24),
                  Container(
                    padding: const EdgeInsets.symmetric(horizontal: 36),
                    alignment: Alignment.center,
                    child: QsText("您需要关注该专家以后，购买该方案才能享受不中退款。",
                        fontSize: 16,
                        color: Colours.grey66,
                        textAlign: TextAlign.center),
                  ),
                  Container(height: 50),
                  QsButton(
                    width: Get.width,
                    height: 44,
                    onPressed: () async {
                      await UserApi.focus(expertId: planInfo?.expertId);
                      Get.back(result: true);
                    },
                    backgroundColor: Colours.main,
                    text: "关注并支付",
                    borderRadius: 4,
                    textStyle:
                        const TextStyle(color: Colours.white, fontSize: 16),
                  ),
                  Padding(
                    padding: EdgeInsets.only(
                        top: 16, bottom: GetPlatform.isAndroid ? 0 : 17),
                    child: GestureDetector(
                      onTap: () {
                        Get.back(result: true);
                      },
                      child: Container(
                        width: Get.width,
                        alignment: Alignment.center,
                        child: QsText("不关注并支付", color: Colours.grey99),
                      ),
                    ),
                  )
                ],
              )
            ],
          ),
        ));
  }
}
